import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 三级联动组件
import TypeNav from '@/components/TypeNav'
import Pagination from '@/components/Pagination'
// import { reqCategoryList } from '@/api'
// 引入Mock
import '@/mock/mockServer'
// 引入swiper
import 'swiper/css/swiper.css'
// import { reqGetSearchInfo } from '@/api'
// console.log(reqGetSearchInfo({}));
import *as API from '@/api'
import { Button, MessageBox } from 'element-ui';
import atm from '@/assets/images/1.gif'
// reqCategoryList()
Vue.component(TypeNav.name, TypeNav)
Vue.component(Pagination.name, Pagination)
Vue.config.productionTip = false
// 按需引入饿了吗ui
Vue.use(Button)

// elm组件注册挂载原型
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// 引入仓库
import store from './store'
import VueLazyload from 'vue-lazyload'
// 引入表单校验插件
import '../vee-validate/validate'
Vue.use(VueLazyload, {
  loading: atm
})
new Vue({
  render: h => h(App),
  // 全局事件总线
  beforeCreate () {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  store
}).$mount('#app')
